home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-21 | 5.7 KB | 189 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: ClockPar.h
- // Release Version: $ 1.0d1 $
- //
- // Author: Lonnie Millett
- // Creation Date: 3/28/94
- //
- // Copyright: © 1993, 1994 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef CLOCKPAR_H
- #define CLOCKPAR_H
-
- #ifndef CCLOCKDEF_H
- #include "CClockDef.h"
- #endif
-
- #ifndef FWPART_H
- #include <FWPart.h>
- #endif
-
- //==============================================================================
- // Classes defined in this interface
- //==============================================================================
-
- class CClockPart;
-
- //==============================================================================
- // Classes used by this interface
- //==============================================================================
-
- class FW_CPart;
- class XMPStorageUnit;
- class XMPSession;
- class XMPFrame;
- class XMPFocusSet;
-
- //==============================================================================
- // Constants
- //==============================================================================
-
- const XMPCommandID cClockType = 10000;
- const XMPCommandID cClockSoundsNone = 10001;
- const XMPCommandID cClockSoundsTick = 10002;
- const XMPCommandID cClockSoundsChime = 10003;
- const XMPCommandID cClockSoundsBoth = 10004;
- const XMPCommandID cClockPlayChimeSound = 10005;
-
- const short kAnalogClock = 1;
- const short kDigitalClock = 2;
-
- //==============================================================================
- // CClockPart
- //==============================================================================
-
- class CClockPart : public FW_CPart
- {
-
- public:
- CClockPart();
- virtual ~ CDECL CClockPart();
-
- virtual void Release();
-
- virtual void Initialize();
-
- virtual XMPValueType GetContentPropertyValueType() const;
-
- unsigned long GetLastTime() const;
- void SetLastTime(unsigned long lastTime);
-
- short GetClockType() const;
- void SetClockType(short clockType);
-
- short GetClockSounds() const;
- void SetClockSounds(short clockSounds);
-
- PicHandle GetBackgroundPICT() const;
- void SetBackgroundPICT(PicHandle backgroundPICT);
-
- FW_PlatformHandle GetChimeSound() const;
- void SetChimeSound(FW_PlatformHandle chimeSound);
-
- XMPTypeToken GetAudioFocusToken() const;
-
- virtual FW_CFrame* NewFrame(XMPFrame* xmpFrame, XMPTypeToken presentation);
- virtual void AddDisplayFrame(XMPFrame* xmpFrame);
- virtual void RemoveDisplayFrame(XMPFrame* xmpFrame);
-
- virtual FW_Boolean DoIdle();
- virtual FW_Boolean DoMenuEvent(XMPMenuBar *menuBar, XMPCommandID commandID);
- virtual void DoAdjustMenus(XMPMenuBar* menuBar);
-
- virtual void InternalizeContent(XMPStorageUnit* storageUnit);
- virtual void ExternalizeContent(XMPStorageUnit* storageUnit);
-
- virtual FW_CSelection* NewSelection();
-
- void PlayTickSound();
- void PlayChimeSound();
-
- private:
- unsigned long fLastTime;
- short fClockType;
- short fClockSounds;
- FW_PlatformHandle fChimeSound;
- FW_PlatformHandle fTickSound;
- PicHandle fBackgroundPICT;
- XMPTypeToken fAudioFocusToken;
- XMPFocusSet* fAudioFocusSet;
- XMPFrame* fAudioFocusFrame;
- };
-
- //----------------------------------------------------------------------------------------
- // CClockPart::GetLastTime
- //----------------------------------------------------------------------------------------
- inline unsigned long CClockPart::GetLastTime() const
- {
- return fLastTime;
- }
-
- //----------------------------------------------------------------------------------------
- // CClockPart::SetLastTime
- //----------------------------------------------------------------------------------------
- inline void CClockPart::SetLastTime(unsigned long lastTime)
- {
- fLastTime = lastTime;
- }
-
- //----------------------------------------------------------------------------------------
- // CClockPart::GetClockType
- //----------------------------------------------------------------------------------------
- inline short CClockPart::GetClockType() const
- {
- return fClockType;
- }
-
- //----------------------------------------------------------------------------------------
- // CClockPart::SetClockType
- //----------------------------------------------------------------------------------------
- inline void CClockPart::SetClockType(short clockType)
- {
- fClockType = clockType;
- }
-
- //----------------------------------------------------------------------------------------
- // CClockPart::GetClockSounds
- //----------------------------------------------------------------------------------------
- inline short CClockPart::GetClockSounds() const
- {
- return fClockSounds;
- }
-
- //----------------------------------------------------------------------------------------
- // CClockPart::SetClockSounds
- //----------------------------------------------------------------------------------------
- inline void CClockPart::SetClockSounds(short clockSounds)
- {
- fClockSounds = clockSounds;
- }
-
- //----------------------------------------------------------------------------------------
- // CClockPart::GetAudioFocusToken
- //----------------------------------------------------------------------------------------
- inline XMPTypeToken CClockPart::GetAudioFocusToken() const
- {
- return fAudioFocusToken;
- }
-
- //----------------------------------------------------------------------------------------
- // CClockPart::GetChimeSound
- //----------------------------------------------------------------------------------------
- inline FW_PlatformHandle CClockPart::GetChimeSound() const
- {
- return fChimeSound;
- }
-
- //----------------------------------------------------------------------------------------
- // CClockPart::GetBackgroundPICT
- //----------------------------------------------------------------------------------------
- inline PicHandle CClockPart::GetBackgroundPICT() const
- {
- return fBackgroundPICT;
- }
-
- #endif
-